//
//  EMAboutViewController.m
//  ElectronicMall
//
//  Created by 史伟文 on 14/12/26.
//  Copyright (c) 2014年 cczu. All rights reserved.
//

#import "EMAboutViewController.h"
#import "UINavigationController+EMNavi.h"

@interface EMAboutViewController ()

@end

@implementation EMAboutViewController
- (void)hideBottomBar
{
    for(UIView *view in self.view.subviews)
    {
        if([view isKindOfClass:[UITabBar class]])
            view.hidden = YES;
    }
}
- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];
    [self hideBottomBar];
    self.view.backgroundColor = RGB(242, 242, 242);
    [self.navigationController setNavigationMode:EMNavigationModeDefault andSubMode:0];
    self.navigationItem.title = @"关于沃佳";
    
    UIButton *button =[UIButton buttonWithType:UIButtonTypeCustom];
    button.frame=CGRectMake(0, 0, 30, 32);
    [button setImage:[UIImage imageNamed:@"button_导航_返回_白"] forState:UIControlStateNormal];
    [button addTarget:self action:@selector(backAction:) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.leftBarButtonItem =[[UIBarButtonItem alloc]initWithCustomView:button];
}
- (void)backAction: (UIButton *)sender
{
    [self.navigationController popViewControllerAnimated:YES];
}

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
    
    int height = 64 + 25;
    UILabel *versionLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, height, 280, 20)];
    versionLabel.text = @"当前版本:\tV1.00.01";
    versionLabel.textColor = [UIColor darkGrayColor];
    versionLabel.textAlignment = NSTextAlignmentLeft;
    versionLabel.font = [UIFont fontWithName:HEITIMEDIUM size:16];
    [self.view addSubview:versionLabel];
    
    height += 20 + 15;
    UILabel *wcTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, height, 280, 20)];
    wcTitleLabel.text = @"沃佳官方微信";
    wcTitleLabel.textColor = [UIColor darkGrayColor];
    wcTitleLabel.textAlignment = NSTextAlignmentLeft;
    wcTitleLabel.font = [UIFont fontWithName:HEITIMEDIUM size:14];
    [self.view addSubview:wcTitleLabel];
    height += 20 + 5;
    UIImageView *wcImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_qrCode"]];
    wcImage.frame = CGRectMake(40, height, 100, 100);
    [self.view addSubview:wcImage];
    UIImageView *arrowImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_关于_箭头"]];
    arrowImage.frame = CGRectMake(140, height + 40, 50, 25);
    [self.view addSubview:arrowImage];
    UILabel *wcTipLabel = [[UILabel alloc] initWithFrame:CGRectMake(190, height + 22, 120, 60)];
    NSMutableParagraphStyle *paraStyle = [[NSMutableParagraphStyle alloc] init];
    paraStyle.lineSpacing = 8;
    NSDictionary *attributes = @{
                                 NSFontAttributeName:[UIFont fontWithName:HEITILIGHT size:14],
                                 NSParagraphStyleAttributeName: paraStyle,
                                 
                                 };
    wcTipLabel.attributedText = [[NSAttributedString alloc] initWithString:@"扫描关注商城微信即时了解最新活动以及商品详情！" attributes:attributes];
    wcTipLabel.numberOfLines = 0;
    wcTipLabel.textColor = [UIColor darkGrayColor];
    wcTipLabel.textAlignment = NSTextAlignmentLeft;
    wcTipLabel.font = [UIFont fontWithName:HEITIMEDIUM size:14];
    [self.view addSubview:wcTipLabel];
    
    height += 100 + 15;
    UILabel *pTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(20, height, 280, 20)];
    pTitleLabel.text = @"沃佳手机客户端";
    pTitleLabel.textColor = [UIColor darkGrayColor];
    pTitleLabel.textAlignment = NSTextAlignmentLeft;
    pTitleLabel.font = [UIFont fontWithName:HEITIMEDIUM size:14];
    [self.view addSubview:pTitleLabel];
    height += 20 + 5;
    UIImageView *piImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_qrCode"]];
    piImage.frame = CGRectMake(40, height, 100, 100);
    [self.view addSubview:piImage];
    UIImageView *paImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_qrCode"]];
    paImage.frame = CGRectMake(180, height, 100, 100);
    [self.view addSubview:paImage];
    height += 100 ;
    UIImageView *piIconImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_关于_苹果"]];
    piIconImage.frame = CGRectMake(40, height, 36, 36);
    [self.view addSubview:piIconImage];
    UIImageView *paIconImage = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_关于_安卓机器人"]];
    paIconImage.frame = CGRectMake(180, height, 36, 36);
    [self.view addSubview:paIconImage];
    UILabel *piTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(63, height + 12, 80, 20)];
    piTitleLabel.text = @"Andriod";
    piTitleLabel.textColor = [UIColor darkGrayColor];
    piTitleLabel.textAlignment = NSTextAlignmentCenter;
    piTitleLabel.font = [UIFont fontWithName:HEITIMEDIUM size:14];
    [self.view addSubview:piTitleLabel];
    UILabel *paTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(203, height + 12, 80, 20)];
    paTitleLabel.text = @"iPhone";
    paTitleLabel.textColor = [UIColor darkGrayColor];
    paTitleLabel.textAlignment = NSTextAlignmentCenter;
    paTitleLabel.font = [UIFont fontWithName:HEITIMEDIUM size:14];
    [self.view addSubview:paTitleLabel];
    
    
    UIImageView *logoImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"icon_logo"]];
    logoImageView.frame = CGRectMake(0, 0, 96, 18);
    logoImageView.center = CGPointMake([UIScreen mainScreen].bounds.size.width / 2, [UIScreen mainScreen].bounds.size.height - 36);
    [self.view addSubview:logoImageView];
    
    UILabel *logoLabel = [[UILabel alloc] initWithFrame:CGRectMake(0, [UIScreen mainScreen].bounds.size.height - 24, [UIScreen mainScreen].bounds.size.width, 20)];
    logoLabel.font = [UIFont fontWithName:HEITILIGHT size:10];
    logoLabel.textColor = [UIColor grayColor];
    logoLabel.textAlignment = NSTextAlignmentCenter;
    logoLabel.text = @"Copyright © 2014 wojiaxiansheng.com. All Right Reserved";
    [self.view addSubview:logoLabel];
    
}


@end
